<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=11">
         <link rel="stylesheet" href="<%=basePath%>css/cssreset.css">
        <link rel="stylesheet" href="<%=basePath%>css/pagination.css">
        <link rel="stylesheet" href="<%=basePath%>style/kaihushenpi.css">
        <script src="<%=basePath%>js/jquery.min.js"></script>
        <script src="<%=basePath%>js/jquery.pagination.js"></script>
        <script src="<%=basePath%>js/menu.js"></script>
        <script src="<%=basePath%>salejihui/My97DatePicker/WdatePicker.js"></script>
        <style type="text/css">
        a{
        	text-decoration:none;
			color:#708dac;
        }
		.psxa{
			color:#708dac;
			width:100%;
			line-height:23px;
			text-align: center;
			margin-top:27px;
			font-family: '微软雅黑';
			cursor:pointer;
			font-size:16px;
		}
		.psxa>a{
			text-decoration:none;
			color:#708dac;
		}
		.ims{
			position:relative;
			top:4px;
			right:22px;
		}
		#cover3{
			position:fixed;
			top:50%;
			left:50%;
			margin-left:-406px;
			margin-top:-172px;
			display:none;
		}
    </style>
    </head>
    <body>
     <c:if test="${show!=null}">
      <script type="text/javascript">
      window.onload=function(){  
    	     alert("${show}");
    	} 
      </script>
      </c:if>
    	<div class="headerxs">
    		<p class="pa">客户管理系统CRM</p>
    		<p class="rights">
	    		<img src="../images/user.png" alt="">
	    			${staff.staff_name}
	    		<button onclick="dians()"></button>
    		</p>
    	</div>
    	<section>
    		<ol class="lefts">
    			<li class="pb">
    				<img src="../images/Users and permissions.png" alt="">
    				用户和权限
    				<img src="../images/button (2).png" alt="">
    				<div class="div1">
    					<p class="zcd" id="zcd1"><a href="../html/setupgroups.html">角色管理</a></p>
						<p class="zcd" id="zcd2"><a href="../html/bumenyonghuguanli.html">部门/用户管理</a></p>
    				</div>
    			</li>
    			<li class="px">
    				<img src="<%=basePath %>images/canshu.png" alt="">
    				业务参数和设定
    				<img src="<%=basePath %>images/button (2).png" alt="">
    				<div class="div1">
    					<%-- <p class="zcd" id="zcd1" name="ppa"><a href="<%=basePath %>tradeManage/select.action">行业管理</a></p>
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>compactGenre/select.action">合同类型</a></p>
                        <p class="zcd" id="zcd1" name="ppa"><a href="<%=basePath %>rank/select.action">客户级别</a></p>--%>
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>rank/select.action">申请性质</a></p> 
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>salestage/select.action">产品类别</a></p>
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>record/select.action">来源渠道</a></p>
    				</div>
    			</li>
                <li class="py">
                    <img src="<%=basePath %>images/liucheng.png" />
                    	流程管理
                    <img src="<%=basePath %>images/button (2).png" />
                    <div class="div1" style="display:block">
                        <p class="zcd" id="zcd1"><a href="<%=basePath %>approveRole/select.action">审批流程管理</a></p>
                        <p class="zcd" id="zcd1"><a href="<%=basePath%>approve/count.action?pageSize=2" style="color:#fff;">已审批流程查看</a></p>
                    </div>
                </li>
                <li class="pxa">
                    <img src="../images/gonggao.png" alt="" width="18px">
                    <a href="../notice/page.action" style="color:#708dac;text-decoration: none;">公告管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
                </li>
                <li class="pxaa">
                    <img src="../images/kehu (1).png" alt="">
                    		资源开发
                    <img src="../images/button (2).png" alt="">
                    <div class="div1">
                        <p class="zcd" id="zcd1"><a href="<%=basePath %>client/weifencount.action?zhuizong=0">用户开发</a></p>
                        <p class="zcd" id="zcd2"><a href="../client/findByAllForAgent.action?start=1">代理开发</a></p>
                    </div>
                </li> 
               <%--  <li class="pxas">
    				<img src="../images/kehuzilao.png" alt="">
    				客户资料
    				<img src="../images/button (2).png" alt="">
    				<div class="div1" >
    					<p class="zcd" id="zcd1"><a href="<%=basePath%>client/findByAllData.action?start=1">用户资料</a></p>
						<p class="zcd" id="zcd2"><a href="<%=basePath%>client/findByAllData.action">代理资料</a></p>
    				</div>
    			</li> --%>
    			<li class="psxa">
    				<img src="../images/operation-management.png" alt="" width="16px" class="ims">
    				<a href="<%=basePath %>Operate/count1.action">运营管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
    			</li>
    		</ol>
    		<div class="righta">
    			<div class="smalls">
    				<p class="pj">开户审批</p>
    				 <form action="<%=basePath%>audits/count.action?pageSize=2" method="post" style="float:right;margin-right:260px;" onsubmit="return tims()">
		 					 	
		 					 	<input type="text" placeholder="单位名称" name="condition" value="${condition}" style="width:200px;height:38px;position:relative;top:6px;border:1px solid #ccc;text-align:center;border-radius:5px;">
		 					 	<input type="submit" value="搜索" style="width:60px;height:38px;position:relative;top:6px;border:none;text-align:center;border-radius:5px;margin-left:10px;cursor:pointer;background:#1fd4fb;color:#fff;">
		 					 	<input type="button" onclick="daochu()" value="导出" style="width:60px;height:38px;position:relative;top:6px;border:none;text-align:center;border-radius:5px;margin-left:100px;cursor:pointer;background:#1fd4fb;color:#fff;">
		 					 </form>
    				<div class="fen">
		    			<div class="headers">
		    				<p class="headersa"><a href="<%=basePath%>approve/count.action?pageSize=2" style="color:#000;">开户审批</a></p>
		    				<p class="headersb"><a href="<%=basePath%>audits/count.action?pageSize=2"style="color:#fff;">合同审核</a></p>
		    			</div>
		    		</div>
		    		<div class="xiangqing">
		    			<table>
    								<thead>
    									<tr>
    										<td>编码</td>
    										<td>单位名称</td>
    										<td>负责人</td>
    										<td>申请类型</td>
    										<td>承担百分比</td>
    										<td>产品类别</td>
    										<td>审批人</td>
    										<td>审批状态</td>
    										<td></td>	
    									</tr>
    								</thead>
    								<tbody class="tbodys">
    									
    								</tbody>
    							</table>
		    		</div>
		    		<div class="M-box" style="width:40%;margin:0px auto;"></div>
    			</div>
    			
    		</div>
    		
    	</section>
    	<footer>
				<!-- <div id="cover3">
						<form id="cover-content2" method="post">
							<h4>合 同 审 核 详 情<img src="../images/guanbi.png" alt="" class="guan"></h4>
							<p class="main">
                                <span class="leftmain">申 请 单 位</span>
                                <input type="text" class="shurukuang" id="applicant">
                            </p>
                            <p class="main">
                                <span class="leftmain">生 效 时 间</span>
                                <input type="text" id="effectTimeStart"  class="shurukuang" style="width:100px;margin-right:20px">至<input type="text" id="effectTimeFinish"  class="shurukuang" style="width:100px;margin-left:20px;">
                            </p>
                            <p class="main">
                                <span class="leftmain">申 请 类 型</span>
                                <input type="text" id="auditType"  class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">承担百分比</span>
                                <input type="text" id="assumePercentage"  class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">保 证 金&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                <input type="text" id="deposit" class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">保证金模式</span>
                                <input type="text" id="depositPattern" class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">提 交 时 间</span>
                                <input type="text" id="submitTime"  class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">审 批 类 型</span>
                                <input type="text" id="approveTailId"  class="shurukuang">
                            </p>
                              <p class="main">
								<span class="leftmain">产 品 类 别</span>
								<input type="text"  class="pCategory shurukuang"  id="pCategory" style="width:255px;">
							</p>
							<p class="main">
								<span class="leftmain">负 责 人</span>
								<input type="text"  class="rPerson shurukuang"  id="rPerson"  style="width:255px;">
							</p>
                      		<p class="main">
								<span class="leftmain">审 批 状 态</span>
								<input type="text" id="approvalState"  class="shurukuang">
								
							</p>
							 
							<p class="main" style="height:100px;">
								<span class="leftmain" style="position:relative;bottom:90px;">审 批 意 见</span>
								<textarea name="" id="approveOpinion" class="shurukuang" style="height:100px;margin-left: 40px;resize:none;"></textarea>
							</p>
							<p class="main" style="height:100px;">
								<span class="leftmain" style="position:relative;bottom:90px;">审 批 说 明</span>
								<textarea name="" id="remarks" class="shurukuang" style="height:100px;margin-left: 40px;resize:none;"></textarea>
							</p>	
						</form>
						
				</div> -->
    	
    	
    				<div id="cover3" >
						<form action="<%=basePath %>audits/update.action" method="post">
							<table>
								<thead class="thed">
									<tr><th colspan="4">合同审核详情<img src="../images/guanbi.png" alt="" class="guan"></th></tr>
								</thead>
								<tbody class="tbod">
									<tr>
										<td>单 位 名 称</td>
										<td><input type="text" class="shurukuang" name="applicant" id="applicant" disabled="disabled"></td>
										<td>负 责 人</td>
										<td><input type="text"  class="rPerson shurukuang" disabled="disabled" name="rPerson" id="rPerson"  style="width:150px;"></td>
									</tr>
									<tr>
										<td>申 请 类 型</td>
										<td><input type="text" id="auditType" name="auditType" disabled="disabled"  class="shurukuang"></td>
										<td>承担百分比</td>
										<td><input type="text" id="assumePercentage" name="assumePercentage" disabled="disabled"  class="shurukuang" style="margin-left:18px;">%</td>
									</tr>
									<tr>
										<td>保 证 金</td>
										<td><input type="text" id="deposit" name="deposit" disabled="disabled" class="shurukuang"></td>
										<td>保证金模式</td>
										<td><input type="text" id="depositPattern" name="depositPattern" disabled="disabled" class="shurukuang"></td>
									</tr>
									<tr>
										<td>产 品 类 别</td>
										<td><input type="text"  class="pCategory shurukuang" disabled="disabled" name="pCategory" id="pCategory" style="width:150px;"></td>
										<td>生 效 时 间</td>
				                       <td><input type="text" disabled="disabled" id="effectTimeStart" name="effectTimeStart" style="width:100px;" onfocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd', readOnly:true})"> 
				                                           至 <input type="text" disabled="disabled" id="effectTimeFinish" name="effectTimeFinish" style="width:100px;" onfocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd', readOnly:true})"></td>
									</tr>
									
									
									<tr>
									<tr>
									<td>
									<input type="button" value="上传1" onclick="supplementa(this)" id=""  class="supplementals" style="height:30px;line-height:30px;background:#bfbfbf;color:#616264;width:150px;text-align: center;border-radius: 5px;">
									</td>
									<td><input type="text" id="supplementals"  class="shurukuang" disabled="disabled"></td>
									<td>
									<input type="button" value="上传2" onclick="supplementalsT(this)" id=""  class="supplementalsTwo" style="height:30px;line-height:30px;background:#bfbfbf;color:#616264;width: 150px;text-align: center;border-radius: 5px;">	
									</td>
									<td><input type="text" id="supplementalsTwo"  class="shurukuang" disabled="disabled"></td>
									
									</tr>
									<tr>
										<td></td>
										<td></td>
										<td><input type="hidden" id="hiddens" name="auditId"></td>
										<td></td>
									</tr>
									<tr>
										<td>签约时间</td>
										<td><input type="text" disabled="disabled" class="shurukuang" id="signTime" onfocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd', readOnly:true})"></td>
										<td></td>
										<td></td>
									</tr>
									<tr><th colspan="4" style="padding:10px 0px;"><input type="submit" value="确认修改" class="smit"/></th></tr>
								</tbody>
							</table>
						</form>
					</div>
    	</footer>
    	
    	<div class="smallas"></div>
    </body>
    <script type="text/javascript">
	function shanc(id){
		  var pageNum="${PageNum}";
    	window.location.href="<%=basePath %>audits/delect.action?id="+id+"&pageNums="+pageNum;
    }
    function daochu(){
    	window.location.href="<%=basePath %>audits/downlaodExecls.action"
    }
            $('.M-box').pagination({
            	  pageCount: ${PageCount},//总页数
      			current: ${PageNum},//当前页码
            callback:function(api){
                var pageNum=api.getCurrent();
                var condition="${condition}";
                $.ajax({  
                    type : "POST",  
                    url : "<%=basePath%>audits/findAllApproveCondition.action",//路径  
                    data : {  
                        pageNum : api.getCurrent(),
                        "condition" : condition       
                    },
                    success : function(data) {
                    	pageNums=api.getCurrent();
                        var number=data[0].number;//总页数
                        api.setPageCount(number);//动态修改总页数为20页
                        var pageNum=data[0].pageNum;
                        var text="";
                        $('.trs').remove();
                      for(var i=0;i<data[0].list.length;i++){
                    	  text=$('<tr class="trs"><td style="cursor:pointer;" onclick="dian('+data[0].list[i].approveId+')">'+data[0].list[i].approveId+'</td>'
  								+'<td>'+data[0].list[i].applicant+'</td><td>'+data[0].list[i].rPerson+'</td>'
  								+'<td>'+data[0].list[i].auditType+'</td>'
  								+'<td>'+data[0].list[i].assumePercentage+'</td><td>'+data[0].list[i].pCategory+'</td>'
  								+'<td>'+data[0].list[i].Approvers+'</td><td>'+data[0].list[i].approvalState+'</td>'
  								+'<td><input type="button" value="删除"  onclick="shanc('+data[0].list[i].approveId+')"/><input type="button" value="修改"  onclick="xiug('+data[0].list[i].approveId+')"/></td>'	
  								+'</tr>')  
                        $('.tbodys').append(text);
                            
                          }
                          /*<div class="content trs"><h6 class="sbox2"><span>审批人：'+data[0].list[i].ApproverId+'</span><span class="qj">审批类型：'+data[0].list[i].type+'</span><span>审批状态：'+data[0].list[i].approvalState+'</span><span style="width:30%;">生效时间：'+data[0].list[i].effectTimeStart+'至'+data[0].list[i].effectTimeFinish+'</span></h6><a href="#" class="more" onclick="dian('+data[0].list[i].approveId+','+pageNum+')">查看更多 ></a></div>*/
                    }
                });  
            }
        },function(api){
            var pageNum;
            var condition="${condition}";
            $.ajax({  
                type : "POST",  
                url : "<%=basePath%>audits/findAllApproveCondition.action",//路径  
                data : {  
                    pageNum : api.getCurrent(),
                    "condition" : condition     
                },
                success : function(data) {
               
                    var number=data[0].number;//总页数
                    api.setPageCount(number);//动态修改总页数为20页
                    var pageNum=data[0].pageNum;
                    var text="";  
                    
                    for(var i=0;i<data[0].list.length;i++){
                    	
                    	text=$('<tr class="trs"><td style="cursor:pointer;" onclick="dian('+data[0].list[i].approveId+')">'+data[0].list[i].approveId+'</td>'
								+'<td>'+data[0].list[i].applicant+'</td><td>'+data[0].list[i].rPerson+'</td>'
								+'<td>'+data[0].list[i].auditType+'</td>'
								+'<td>'+data[0].list[i].assumePercentage+'</td><td>'+data[0].list[i].pCategory+'</td>'
								+'<td>'+data[0].list[i].Approvers+'</td><td>'+data[0].list[i].approvalState+'</td>'
								+'<td><input type="button" value="删除"  onclick="shanc('+data[0].list[i].approveId+')"/><input type="button" value="修改"  onclick="xiug('+data[0].list[i].approveId+')"/></td>'	
								+'</tr>')  
                    $('.tbodys').append(text);
                          }                                 
                }
            });  
        });
        </script> 
    <script>
    $('.guan').click(function(event) {
    	$('body').css('overflow','scroll')
    	$('body').css('overflow-x','hidden')
    	$('.smallas').css('display', 'none');
    	$('#cover3').css('display', 'none');
    });
    	function dian(obj){
    		$('body').css('overflow','hidden')
    		document.getElementById('cover3').style.display='block';
    		$('.smallas').css('display', 'block');
    		$('.smit').css("display","none");
    		$('.tbod input').attr("disabled","disabled");
    		$('.tbod textarea').attr("disabled","disabled");
                 $.ajax({
                     url: '<%=basePath %>audits/findContract.action',
                     type: 'post',
                     data: {approveId: obj},
                     success:function(data){
                    	 /* console.log(data[0].flowNme); */
        
                    	 $('#supplementals').val(data[0].supplementals);//申 请 类 型
                  	   $('#applicant').val(data[0].Applicant);//申 请 单 位
                         $('#effectTimeStart').val(data[0].effectTimeStart);//
                         $('#effectTimeFinish').val(data[0].effectTimeFinish);//--
                         $('#auditType').val(data[0].auditType);//申 请 类 型
                         $('#assumePercentage').val(data[0].assumePercentage);//承 担 百 分 比
                         $('#deposit').val(data[0].deposit);//保 证 金
                         $('#depositPattern').val(data[0].depositPattern);//保 证 金  模 式
                         $('#effectTimeStart').val(data[0].effectTimeStart);//生效时间初
                         $('#effectTimeFinish').val(data[0].effectTimeFinish);//生效时间末
                       
                    
                         $('#pCategory').val(data[0].pCategory);//产品类别
                         $('#hiddens').val(data[0].auditId);//id
                         $('#rPerson').val(data[0].rPerson);//负责人
                         $('#supplementals').val(data[0].supplementals);     
                         $('#supplementalsTwo').val(data[0].supplementalsTwo);
                         $('.supplementals').attr("id",show);
                         $('.supplementalsTwo').attr("id",show);
                         $('#signTime').val(data[0].signTime);//签约时间
                     }
                 });
             }
    	function dians(){
			window.location.href="<%=basePath %>notice/findByAll.action";
			
		}
    	function xiug(show){
    		document.getElementById('cover3').style.display='block';
    		$('.smallas').css('display', 'block');
    		$('.tbod input').removeAttr("disabled");
    		$('.tbod textarea').removeAttr("disabled");
    		$(".smit").css("display","inline");
    		$("#approvalState").attr("disabled","disabled");
                 $.ajax({
                     url: '<%=basePath %>audits/findContract.action',
                     type: 'post',
                     data: {approveId: show},
                     success:function(data){
                    	 /* console.log(data[0].flowNme); */
           
                       $('#supplementals').val(data[0].supplementals);//申 请 类 型
                	   $('#applicant').val(data[0].Applicant);//申 请 单 位
                       $('#effectTimeStart').val(data[0].effectTimeStart);//
                       $('#effectTimeFinish').val(data[0].effectTimeFinish);//--
                       $('#auditType').val(data[0].auditType);//申 请 类 型
                       $('#assumePercentage').val(data[0].assumePercentage);//承 担 百 分 比
                       $('#deposit').val(data[0].deposit);//保 证 金
                       $('#depositPattern').val(data[0].depositPattern);//保 证 金  模 式
                       $('#effectTimeStart').val(data[0].effectTimeStart);//生效时间初
                       $('#effectTimeFinish').val(data[0].effectTimeFinish);//生效时间末
                     
                       $('#pCategory').val(data[0].pCategory);//产品类别
                       $('#hiddens').val(data[0].auditId);//id
                       $('#rPerson').val(data[0].rPerson);//负责人
                       $('#supplementals').val(data[0].supplementals);     
                       $('#supplementalsTwo').val(data[0].supplementalsTwo);
                       $('.supplementals').attr("id",show);
                       $('.supplementalsTwo').attr("id",show);
                     }
                 });
             }
    	  function supplementa(obj){
          	
          	window.location.href="<%=basePath %>audits/download.action?vlaues=0&id="+obj.id;
          }   
          function supplementalsT(obj){
          	
          	window.location.href="<%=basePath %>audits/download.action?vlaues=1&id="+obj.id;
          }   
    </script>
</html>